//
//  ZJsecuritycodeView.m
//  ZiJinLian
//
//  Created by lzy on 2017/3/14.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "ZJsecuritycodeView.h"

@implementation ZJsecuritycodeView

-(id)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
         self.backgroundColor=RGB(246, 246, 246);
        [self addSubview:self.phoneLab];
        [self addSubview:self.securitycodeTF];
        [self addSubview:self.getsecuritycodeBtn];
        [self addSubview:self.nextBtn];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    [self layout];
}
-(void)layout
{
    [self.phoneLab makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(30);
        make.right.equalTo(self).offset(0);
        make.left.equalTo(self).offset(0);
        make.height.equalTo(98/2);
        

    }];
    [self.securitycodeTF makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.phoneLab.mas_bottom).offset(30);
        make.right.equalTo(self.getsecuritycodeBtn.mas_left).offset(-10);
        make.left.equalTo(self).offset(10);
        make.height.equalTo(98/2);
    }];
    [self.getsecuritycodeBtn makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.phoneLab.mas_bottom).offset(30);
        make.right.equalTo(self).offset(-10);
        make.height.equalTo(98/2);
        make.width.equalTo(268/2);
        
    }];
    
    [self.nextBtn makeConstraints:^(MASConstraintMaker *make) {
        //make.centerX.equalTo(self.view);
        make.left.equalTo(self.mas_left).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.top.equalTo(self.securitycodeTF.mas_bottom).offset(30);
        make.height.equalTo(98/2);
        
    }];

    
}
-(UILabel *)phoneLab
{
        
    if (!_phoneLab) {
        _phoneLab=[MYUI createLableFrame:CGRectMake(0, 0, MainW, 0) backgroundColor:[UIColor clearColor] text:nil textColor:TextColor3 font:FontAndStyle14 numberOfLines:0 adjustsFontSizeToFitWidth:YES];
        _phoneLab.textAlignment=NSTextAlignmentCenter;
        
        
    }
    return _phoneLab;
    
}

-(UITextField *)securitycodeTF
{
    if (!_securitycodeTF) {
        _securitycodeTF=[MYUI createTextFieldFrame:CGRectMake(0,0, 0, 0) backgroundColor:[UIColor whiteColor] placeholder:MyString(@"请输入验证码") clearsOnBeginEditing:NO];
        _securitycodeTF.keyboardType=UIKeyboardTypeNumberPad;
        
    }
    return _securitycodeTF;
}

//获取验证码按钮
-(UIButton *)getsecuritycodeBtn
{
    if (!_getsecuritycodeBtn) {
        _getsecuritycodeBtn=[MYUI creatButtonFrame:CGRectMake(0, 0, 0, 0) backgroundColor:[UIColor whiteColor] setTitle:MyString(@"获取验证码")setTitleColor:button_Red_Color ];
    }
    return _getsecuritycodeBtn;
}


-(UIButton *)nextBtn{
    if (!_nextBtn) {
        
        _nextBtn=[MYUI creatButtonFrame:CGRectMake(0,0,0,0) backgroundColor:button_gray_Color setTitle:MyString(@"下一步") setTitleColor:Btn_TxTGray_Color ];
        _nextBtn.layer.cornerRadius=5;
        _nextBtn.layer.masksToBounds=YES;
        _nextBtn.titleLabel.font=FontAndStyle15;
        
    }
    return _nextBtn;
}


@end
